1. Field of the Invention
This invention relates to a copying method between logical disks, disk storage system and storage medium for copying between logical disks, and in more particular to a copying method, disk-storage system and storage medium that makes immediate access of a logical disk in response to a copy command possible.
2. Prior Art
A logical disk is a disk that appears to be unrelated to physical restrictions imposed by a physical disk. A logical disk can be constructed from a plurality of physical disk devices, or from one physical disk with a plurality of logical disks. The kind of disk used is determined by the parameters of capacity and performance.
This typical system is called RAID (for example 0, 1, 0+1, 3, 5) rank or RAID group.
Copying between logical disks is used as a backup for saving data as well as other uses. For example, executing a test while continuing work. In this case, the logical disk that is used for work is copied and the copy-destination logical disk is used by the test system. By doing this, the work being performed using the copy-source logical disk is not affected even if data are damaged by the test system that uses the copy-destination logical disk.
Also, a logical disk can be used in online work by copying the logical disk used in online work and using the copy-destination logical disk in batch processing. By doing this, the performance of the online work that uses the copy-source logical disk is not affected by the batch processing.
Many cases such as these which require copying between logical disks are increasing. However, work must be stopped while copying the logical disk. For example, it can take one hour to copy 9 Gbytes. In 24-hour continuous operating conditions of recent years, it is desirable to make the work stop time as close to zero as possible by making the copy time as close to zero as possible.
FIG. 13 to FIG. 16 are drawings explaining the prior art. FIG. 13 and FIG. 14 explain the prior separate dual volume system, FIG. 15 explains the prior log structured file system, and FIG. 16 explains the prior concurrent copy system.
The following methods are known as methods for copying logical-disk data in a prior RAID device.
(1) Separate Dual Volume System
In a system comprising a host 90 and RAID device 91 as shown in FIG. 13, first a copy instruction is sent from the host 91, as sown in FIG. 14, and the copy-source volume (logical disk) 93 is prepared (defined). Next, in response to an xe2x80x9cEstablish Pairxe2x80x9d instruction, copying begins from a primary (copy-source logical disk) 93 to a secondary (copy-destination logical disk) 94 (create a dual state). Establishment of a pair is completed after copying is finished (after the dual state is created). Establishment this dual state is created, an update process request from the host 90 is reflected by primary (copy-source logical disk) 93 and secondary (copy-destination logical disk) 94. By issuing an instruction to separate the dual pairs, copying of the logical volume at the state is complete. Now, as shown in FIG. 13, it is possible for different hosts (applications) 90, 95 to use the primary (copy-source logical disk) 93 and secondary (copy-destination logical disk) 94.
As shown in FIG. 14, the primary (copy-source logical disk) 93 can be accessed during copying, however, the secondary (copy-destination logical disk) cannot be accessed during copying.
(2) Log Structured File System
As shown in FIG. 15, logical disks A, B, C have been defined by the host. Each data block is stored in one physical disk 96. Each of the logical disks is defined by a data pointer of the physical disk 96. Copying from a logical disk A to a logical disk B, is performed by setting the pointer of the logical disk B as pointer of the logical disk A.
Moreover, the update data B2 for the logical disk B are stored in the physical disk separately from the original data. Also, by updating the pointer of the logical disk B to the pointer of the update data B2, it is possible to update the logical disk B without changing the original data A1 to A6 of the logical disk A.
This method is not followed by copying of actual data, and by setting pointers, the copy operation can completed immediately.
(3) Concurrent Copy System
As shown in FIG. 16, when copying from the copy-source disk 93 to the copy-destination disk 94, the host 90 reads the data to be copied from the copy-source disk (A), and with a data transfer function, writes the data to the copy-destination disk 94. The bitmap of the copied address is set as copied.
When there is an update request for an uncopied area of the copy-source disk 93 during copying, that data of the copy-source disk 93 is stored away in a side file 92 as shown a mark (1). That address portion of the bitmap is set as being stored away in a side file as shown a mark (2). The copy-source disk 93 is also updated as shown a mark (3). When copying data that have been stored away in the side file 92, the data to be copied are read from the side file 92 and, with the data transfer function, are written to the copy-destination disk 94 as shown a mark (4). This method makes it possible for the host to reference and update the copy-source disk 93 during copying.
The prior art, however, had the following problems.
(1) In the separate dual volume system shown in FIG. 13 and FIG. 14, it is not possible to access the copy-source disk during copying. Therefore, to access the copy-source disk it is necessary to wait until copying is finished. For example, copying 9 Gbytes takes about 1 hour, so it is necessary to wait 1 hour. Therefore operation must be performed on a schedule.
(2) In the log structured system shown in FIG. 15, it is possible to access both the copy-source logical disk and copy-destination logical disk with a copy instruction, however, since actual data are not copied, the advantages of a dual system where data are copied on separate disks cannot be realized. In other words, damage to the copy-source logical disk is also damage to the copy-destination logical disk, so when the copy-destination physical disk is damaged, it is also not possible to use the copy-source logical disk. Moreover, accessing the copy-destination physical disk, also means accessing the copy-source physical disk, so it is not possible to obtain high-speed performance from using separate disks.
(3) In the concurrent copy system shown in FIG. 16, access of the copy-source logical disk is also possible during copying, however, in order to access the copy-destination logical disk, it is necessary to wait unit copying is finished.
The objective of this invention is to provide a logical-disk copying method, disk-storage system and storage medium that can be accessed immediately in the copy complete state according to a copy instruction even though copying real data.
Another objective of this invention is to provide a logical-disk copying method, disk-storage system and storage medium for making it possible to access a copy-destination logical disk even during copying.
A further objective of this invention is to provide a logical-disk copying method, disk-storage system and storage medium for determining whether or not the access area has been copied and for making it possible to access the copy-destination logical disk.
This invention is a method for copying data from a copy-source logical disk to a copy-destination logical disk according to a copy instruction. This copying method comprises a step of copying data, in units of each area divided the copy-source logical disk, from the copy-source logical disk to the copy-destination logical disk, a step of interrupting the copy process when receive an access request for the copy-source logical disk or the copy-destination logical disk during copying, and a step of processing said access request.
This access processing step comprises a step of updating the target access area of the copy-source logical disk after the target access area has been copied to the copy-destination logical disk when said request is a request for updating uncopied area of the copy-source logical disk, a step of reading the target access area of the copy-source logical disk when said request is a request for referring uncopied area of the copy-destination logical disk, and a step of updating the target access area of the copy-destination logical disk and prohibiting copying of the target access area when said request is a request for updating of uncopied area of the copy-destination logical disk.
In this invention, system returns immediately a copy complete reply according to a copy instruction, and receives an access request and performs reference and update access of the copy-source or copy-destination logical disk while copying actual data. In order to do this, the copy-source logical disk is divided into a plurality of areas and copied to the copy-destination logical disk in units of the area divisions. When there is an access request during copying, it interrupts the copy operation and executes the access request.
Second, access process is changed depending on whether the target access area is a copied area or uncopied area. In other words, when performing reference or update access of a copied area, since copying is finished, access is allowed. On the other hand, when accessing an uncopied area, the data when the copy instruction are saved and then access is allowed. In other words, when performing reference access of an uncopied area of the copy-source logical disk, since there is no change in data, access is allowed as is. When performing update access of an uncopied area of the copy-source logical disk, the uncopied data before the update would be lost if update is performed as is, so the target access area of the copy-source logical disk is copied to the copy-destination logical disk, thereby the data before the update are moved to the copy-destination logical disk. Then, the target access area of the copy-source logical disk is updated. In this way, it is possible to copy data before an update when there is a copy instruction.
Furthermore, when performing reference access of an uncopied are of the copy-destination logical disk, the data of that area of the copy-source logical disk are read since copying is not yet finished. By doing this, it is possible to reference the copy data of that area even when the area is an uncopied area of the copy-destination logical disk, and it becomes possible to reference data when there is a copy instruction even for the copy-destination logical disk.
When performing update access of an uncopied area of the copy-destination logical disk, the copy-destination logical disk is updated with update data. Also, copying of that are is prohibited. In this way, it is possible to prevent update data of that area of the copy-destination logical disk from being changed by copying.
In another feature of this invention, the access step further comprises a step of referencing the target access area of the copy-source logical disk when performing reference access of the copy-source logical disk, and a step of referencing or updating the target access area of the copy-destination logical disk when accessing copied area of the copy-destination logical disk.
In another feature of this invention, the step of referencing an uncopied area comprises a step of copying the target access area of the referenced copy-source logical disk to the copy-destination logical disk after the target access area of the copy-source logical disk has been referenced. By doing this, it becomes possible to copy together with referencing.
In another feature of this invention, the copying step comprises a step of referencing control information that indicates the copying conditions of the areas, and setting the next copy area, and a step of updating the control information of the copy area after copying of the copy area has finished. Also, the access step comprises a step of referencing the control information and determining whether the target access area is a copied area or uncopied area.
Since there is control information, it is possible to prevent an area from being copied again even if the data of the target access area are copied first. Moreover, since the control information is used to determine whether or not the target access area is a copied area or uncopied area, it is possible to accurately determine whether the access area is a copied area or uncopied area.
In another feature of the invention, the access step further comprises a step of updating the control information of the target access area after the target access area of the copy-source logical disk has been copied to the copy-destination logical disk.
In this way, it is possible for the control information to accurately indicate the copying condition through access processing even if copying is performed in advance.
In another feature of the invention, the copying step comprises a step of referencing the control information that indicates the copying condition of each of the areas of the copy-source logical disk and setting the next copy area, a step of reading the target area of the copy-source logical disk in memory, a step of updating the control information after the target area has been read, and a step of writing the target area of the memory to the copy-destination logical disk.
By reading the target area in memory, it becomes possible to access the copy-source logical disk by updating the control information.
In another feature of the invention, the copying step comprises a step of referencing a bitmap indicated by a flag that indicates the copying condition of each area and setting the next copy area, and a step of updating the copy area flag of the bitmap.
Since the control information is expressed as a bitmap, it is possible to reduce the amount of memory occupied by the control information.
In another feature of the invention, the copying step further comprises a step of notifying in when copying is finished according to the copy instruction. By doing this, it is possible to immediately know when the access source can be accessed.
The disk storage system of this invention comprises one logical disk that is constructed with one physical disk, another logical disk that is constructed with another physical disk, and a disk control circuit for accessing the data of a specified logical disk according to an access instruction, and copying the data in units of area divisions of the copy-source logical disk to the copy-destination logical disk according to a copy instruction.
When performing update access of an uncopied area of the copy-source logical disk, this disk control circuit updates the target access area of the copy-source logical disk after it has been copied to the copy-destination logical disk. When performing reference access of the an uncopied area of the copy-destination logical disk, the disk control circuit reads the target access area of the copy-source logical disk. When performing update access of an uncopied area of the copy-destination logical disk, the disk control circuit updates the target access area of the copy-destination logical disk, and prohibits copying of the target access area.
As mentioned above, by doing this, it becomes possible to access the copy-source and copy-destination disks, and in accordance to a copy instruction, the host is able to immediately access the copy-destination and copy-source logical disks. In addition, it is possible to avoid the copy-wait state.
Another feature of the disk-storage system of the invention has a memory for storing the control information that indicates the copying condition of the area of the copy-source logical disk, and the control circuit references the control information stored in this memory and determines whether the target access area is a copied area or an uncopied area.
The storage medium of the invention contains information to be copied, in units of area divisions of the copy-source logical disk, to the copy-destination logical disk, and contains information for interrupting the copying process and performing the access process when accessing the copy-source and copy-destination logical disks during the copying process. For performing update access of an uncopied area of the copy-source logical disk, this information for performing the access process comprises information for updating the target access area of the copy-source logical disk after the target access area of the copy-source logical disk has been copied to the copy-destination logical disk. For performing reference access of an uncopied area of the copy-destination logical disk, this information for performing the access process comprises information for referencing the target access area of the copy-source logical disk. When performing update access of an uncopied area of the copy-destination logical disk, this information for performing the access process comprises information for updating the target access area of the copy-destination logical disk and prohibiting copying of the access area.